package com.langangkj.tools.redis.handler.provider;

import com.langangkj.tools.redis.handler.RedisKeyMetaHandler;
import com.langangkj.tools.redis.handler.meta.RedisKeyMeta;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.connection.DataType;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

/**
 * @author ZhouChuGang
 * @version 1.0
 * @project redis-sync-tools
 * @date 2020/4/26 9:49
 * @Description redis key 处理者的提供者
 */
@Slf4j
@Component
public class RedisSyncKeyProvider {

    private static final Map<DataType, RedisKeyMetaHandler> DATA_TYPE_REDIS_KEY_META_HANDLER_MAP = new HashMap<>();

    private static final BlockingQueue<RedisKeyMeta> BLOCKING_QUEUE = new ArrayBlockingQueue<RedisKeyMeta>(1000);

    public Map<DataType, RedisKeyMetaHandler> getTypeRedisKeyMetaHandlerMap() {
        return DATA_TYPE_REDIS_KEY_META_HANDLER_MAP;
    }

    public BlockingQueue<RedisKeyMeta> getBlockingQueue() {
        return BLOCKING_QUEUE;
    }
}
